Class sjl.MultiSet
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sjl.MultiSet

java.lang.Object
   |
   +----sjl.MultiSet

public class MultiSet
extends Object
implements AssociativeContainer, ReversibleContainer
MultiSet is a kind of associative container that supports equal keys (possible contains multiple copies of the same key value) and provides for fast retrieval of the keys themselves.

Copyright © 1996 Finn Bock


Constructor Index

 o MultiSet(InputIterator, InputIterator, Predicate2)
Construct a set and initialize it with the elements in the range [first,last).
 o MultiSet(MultiSet)
Construct a set and initialize it with the contents of another set.
 o MultiSet(Predicate2)
Construct an empty set.

Method Index

 o begin()
Returns the iterator that represents the beginning of the set.
 o beginGeneric()
Returns the iterator that represents the beginning of the set as an untyped iterator.
 o beginRef()
Returns a referenc to the iterator that represents the beginning of the set.
 o count(Object)
Returns the number of element with a key equal to value.
 o empty()
Returns true if set set does not contain any elements.
 o end()
Returns the iterator that represents the end of the set.
 o endGeneric()
Returns the iterator that represents the end of the set as an untyped iterator.
 o endRef()
Returns a reference to the iterator that represents the end of the set.
 o equal_range(Object)
Returns a pair like Pair(lower_bound(value) upper_bound(value)).
 o equals(Object)
Compare the elements in this container with the elements in another container.
 o erase(Iterator)
Erase the element pointed to by the iterator.
 o erase(Iterator, Iterator)
Erase the elements in the range [first,last).
 o erase(Object)
Erase the elements with key equal to value.
 o find(Object)
Search the set for an element with a key equal to value.
 o flush()
Erase all the elements in the container.
 o insert(InputIterator, InputIterator)
Insert the elements from the range [first,last) into the set.
 o insert(Iterator, Object)
Insert an element into the set.
 o insert(Object)
Insert an element into the set.
 o lower_bound(Object)
Returns an iterator pointing to the first element with a key not less than value.
 o max_size()
Returns the maximum number of elements allowed in a set.
 o rbegin()
Returns a copy of the reverse iterator that represents the beginning (end) of the list.
 o rbeginGeneric()
Returns a copy of the reverse iterator that represents the beginning (end) of the list as an untyped Iterator.
 o rend()
Returns a copy of the iterator that represents the end (beginning) of the list.
 o rendGeneric()
Returns a copy of the iterator that represents the end (beginning) of the list as an untyped Iterator.
 o size()
Returns the number of elements in the set.
 o upper_bound(Object)
Returns an iterator pointing to the first element with a key greter than value.

Constructors

 o MultiSet
  public MultiSet(Predicate2 predicate)
Construct an empty set.
Parameters:
predicate - Use predicate as the comparison object.
 o MultiSet
  public MultiSet(MultiSet set)
Construct a set and initialize it with the contents of another set.
Parameters:
set - Initialize the new set with the elements of set.
predicate - Use predicate as the comparison object.
 o MultiSet
  public MultiSet(InputIterator first,
                  InputIterator last,
                  Predicate2 predicate)
Construct a set and initialize it with the elements in the range [first,last).
Parameters:
first - The beginning of the range.
last - The end of the range.
predicate - Use predicate as the comparison object.

Methods

 o flush
  public void flush()
Erase all the elements in the container.
 o equals
  public boolean equals(Object container)
Compare the elements in this container with the elements in another container.
Returns:
true is the elements match.
Overrides:
equals in class Object
 o begin
  public BidirectionalIterator begin()
Returns the iterator that represents the beginning of the set.
 o beginRef
  public BidirectionalIterator beginRef()
Returns a referenc to the iterator that represents the beginning of the set.
 o end
  public BidirectionalIterator end()
Returns the iterator that represents the end of the set.
 o endRef
  public BidirectionalIterator endRef()
Returns a reference to the iterator that represents the end of the set.
 o beginGeneric
  public ForwardIterator beginGeneric()
Returns the iterator that represents the beginning of the set as an untyped iterator.
 o endGeneric
  public ForwardIterator endGeneric()
Returns the iterator that represents the end of the set as an untyped iterator.
 o rbegin
  public ReverseBidirectionalIterator rbegin()
Returns a copy of the reverse iterator that represents the beginning (end) of the list.
 o rend
  public ReverseBidirectionalIterator rend()
Returns a copy of the iterator that represents the end (beginning) of the list.
 o rbeginGeneric
  public Iterator rbeginGeneric()
Returns a copy of the reverse iterator that represents the beginning (end) of the list as an untyped Iterator.
 o rendGeneric
  public Iterator rendGeneric()
Returns a copy of the iterator that represents the end (beginning) of the list as an untyped Iterator.
 o size
  public int size()
Returns the number of elements in the set.
 o max_size
  public int max_size()
Returns the maximum number of elements allowed in a set.
 o empty
  public boolean empty()
Returns true if set set does not contain any elements.
 o insert
  public RBtreeIterator insert(Object value)
Insert an element into the set.
Parameters:
value - The element to insert.
Returns:
An iterator that point to the newly inserted element
 o insert
  public RBtreeIterator insert(Iterator position,
                               Object value)
Insert an element into the set.
Parameters:
position - A hint pointing to where the insert should start to search. If the hint is correct, and the value is inserted right after position, the time is amortized constant.
value - The element to insert.
Returns:
The an iterator that point to the element with a key equal to the key of value
 o insert
  public void insert(InputIterator first,
                     InputIterator last)
Insert the elements from the range [first,last) into the set.
Parameters:
first - The beginning of the range.
last - The end of the range.
 o erase
  public void erase(Iterator position)
Erase the element pointed to by the iterator.
Parameters:
position - Points to the element to be removed.
 o erase
  public int erase(Object value)
Erase the elements with key equal to value.
Returns:
The number of element erased.
 o erase
  public void erase(Iterator first,
                    Iterator last)
Erase the elements in the range [first,last).
Parameters:
first - The beginning of the range.
last - The end of the range.
 o find
  public ForwardIterator find(Object value)
Search the set for an element with a key equal to value.
Parameters:
value - The key to search for.
Returns:
An Iterator pointing to the element with a key equal to value, or end() if such an element is not found.
 o count
  public int count(Object value)
Returns the number of element with a key equal to value.
 o lower_bound
  public RBtreeIterator lower_bound(Object value)
Returns an iterator pointing to the first element with a key not less than value.
 o upper_bound
  public RBtreeIterator upper_bound(Object value)
Returns an iterator pointing to the first element with a key greter than value.
 o equal_range
  public Pair equal_range(Object value)
Returns a pair like Pair(lower_bound(value) upper_bound(value)).

All Packages  Class Hierarchy  This Package  Previous  Next  Index